package com.ruoyi.business.domain.bo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.business.domain.User;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.ExcelConverter;
import com.ruoyi.common.annotation.Excels;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import com.ruoyi.common.excel.converter.ObjectFieldConverter;
import io.swagger.annotations.Api;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * @author 最爱喝兽奶
 * @create 2022/7/13
 **/
@EqualsAndHashCode(callSuper = true)
@Api("用户信息的业务对象")
@Data
public class UserBo extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /** 用户ID */
    private String userId;

    /** 部门ID */
    private String deptId;

    /**
     * 用户的角色id
     */
    private String roleId;

    private String roleName;

    /**
     * 教师id
     */
    private String teacherId;

    /**
     * 学生所在班级
     */
    private List<String> classIds;

    /** 用户账号 */
    @Excel(name = "用户名")
    private String userName;

    /** 用户昵称 */
    @Excel(name = "真实姓名")
    private String nickName;

    /** 用户邮箱 */
    @Excel(name = "邮箱")
    private String email;

    /** 手机号码 */
    @Excel(name = "手机号")
    private String phoneNumber;

    /** 用户性别 */
    @Excel(name = "性别")
    private String sex;

    /** 用户头像 */
    private String avatar;

    /** 密码 */
    private String password;

    /**
     * qq
     */
    @Excel(name = "QQ")
    private String qq;

    /** 盐加密 */
    private String salt;

    /** 帐号状态（0正常 1停用） */
    private String status;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** 最后登录IP */
    private String loginIp;

    /** 最后登录时间 */
    private Date loginDate;

    @Excel(name = "兴趣")
    private String hobby;

    /**
     * 所属分组
     */
    @NotNull(groups = {AddGroup.class})
    @Excel(name = "职务", converter = ObjectFieldConverter.class)
    @ExcelConverter(showField = "role_name", refField = "role_id", refTable = "sys_role", key = "group")
    private String group;

    /**
     * 我的班级
     */
    @NotNull(groups = {AddGroup.class})
    private String myClass;

    /**
     * excel导入时候的班级名称
     */
    @Excel(name = "班级", converter = ObjectFieldConverter.class)
    @ExcelConverter(refField = "id", showField = "class_id", refTable = "T_CLASS_INFO", isMultiply = true, separator = " ", key = "myClassName")
    private String myClassName;


    /**
     * 用户想要修改的新密码
     */
    @NotNull(groups = {AddGroup.class})
    @Excel(name = "密码")
    private String newPassword;

    @Excel(name = "学校")
    private String school;

    @Excel(name = "学院")
    private String college;

}
